package cn.iocoder.yudao.module.system.dal.mysql.erp.sku;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.erp.sku.vo.SkuPageReqVO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.dal.dataobject.erp.sku.SkuDO;
/**
 * 商品sku Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SkuMapper extends BaseMapperX<SkuDO> {

    default PageResult<SkuDO> selectPage(SkuPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SkuDO>()
                .betweenIfPresent(SkuDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(SkuDO::getLength, reqVO.getLength())
                .eqIfPresent(SkuDO::getWidth, reqVO.getWidth())
                .eqIfPresent(SkuDO::getHeight, reqVO.getHeight())
                .eqIfPresent(SkuDO::getWeight, reqVO.getWeight())
                .eqIfPresent(SkuDO::getNum, reqVO.getNum())
                .eqIfPresent(SkuDO::getSku, reqVO.getSku())
                .eqIfPresent(SkuDO::getRemake, reqVO.getRemake())
                .orderByDesc(SkuDO::getId));
    }

}